import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Index
  },
  {
    path: '/login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "login" */ '../views/login.vue')
  },
  {
    path:"/shopcart",
    component: () => import(/* webpackChunkName: "shopcart" */ '../views/shopcart.vue')
  },
  {
    path:"/list",
    component: () => import(/* webpackChunkName: "list" */ '../views/list.vue')
  },
  {
    path:"/lists/:val",
    component: () => import(/* webpackChunkName: "lists" */ '../views/lists.vue'),
    props:true
  },
  {
    path:"/register",
    component: () => import(/* webpackChunkName: "register" */ '../views/register.vue')
  },
  {
    path:"/detail/:lid",
    component: () => import(/* webpackChunkName: "detail" */ '../views/detail.vue'),
    props:true
  },
  {
    path:"/me",
    component: () => import(/* webpackChunkName: "me" */ '../views/wd.vue')
  },
  
]

const router = new VueRouter({
  routes
})

export default router
